package com.jxgc.file.oi;

import java.util.Scanner;

public class arreyText2 {
    public static void main(String[] args) {
        //目标：完成评委打分的案例
        //1.定义一个动态初始化数组，负责存储六个评委的打分

        double[] scores = new double[6];

        Scanner sc = new Scanner(System.in);

        //2.遍历数组中的每个位置，录入评委分数，存入到数组中去
        for (int i = 0; i < scores.length; i++) {

            System.out.println("请您输入当前第" + (i + 1) + "个评委的分数：");
            double score = sc.nextDouble();
            scores[i] = score;
            }
        //3.遍历数组中的每个元素进行求和
        double sum = 0;
        for (int i = 0; i < scores.length; i++) {
            sum += scores[i];

        }
        System.out.println("选手最终的得分是：" + sum/scores.length);
    }







































































































































































































































































































    }

